<?php include 'header-inc.php'; ?>

    <div id="inner-wrap">
        <div id="sidebar">
<?php include 'sidebar-inc.php'; ?>

        </div>
        <div id="content-box">
            <div class="inner-box">
                <div class="cmd">
                    <ul>
                        <li><a href="<?php echo $this->_url('guestbook', null, array(array(FLEA::getAppInf( 'columnAccessor' ) => $_colkey))); ?>">所有留言</a></li>
                    </ul>
                </div>
                <div class="pdbox box">
                    <table>
                        <tr>
                            <th width="5%">编号</th>
                            <th width="10%">用户昵称</th>
                            <th width="35%">留言</th>
                            <th width="10%">显示</th>
                            <th width="15%">留言日期</th>
                            <th width="25%">管理操作</th>
                        </tr>
                        <?php if($data['rows']): ?>
                        <?php foreach($data['rows'] as $row): ?>
                        <tr>
                            <td class="tc"><?php echo $row['comment_id']; ?></td>
                            <td class="tc"><?php echo h(getOption($row['options'], 'username')); ?></td>
                            <td><?php echo h($row['content']); ?></td>
                            <td class="tc"><a href="<?php echo $this->_url('guestbook', 'visibility', array('display'=>$row['displayorder'], 'commentid'=>$row['comment_id'])); ?>"><?php echo $row['displayorder']==1?'是':'否'; ?></a></td>
                            <td class="tc"><?php echo date('Y-m-d H:i', $row['created']); ?></td>
                            <td class="tc"><a href="<?php echo $this->_url('guestbook', 'reply', array(array(FLEA::getAppInf( 'columnAccessor' ) => $_colkey), array('commentid'=>$row['comment_id']))); ?>">回复</a> | <a href="#" onclick="remove(<?php echo $row['comment_id']; ?>)">删除</a></td>
                        </tr>
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </table>
                </div>
                <?php $this->getControl('pagenav', 'pagenav', array('pager'=>$data['pager'], 'manage'=>'admin', 'site'=>(int)$_GET['site'], 'prevLabel'=>'上一页', 'nextLabel'=>'下一页')); ?>
                <div class="clear"></div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
<!--
    // 删除内容时显示提示信息
    function remove(id) {
        var removeUrl = '<?php echo $this->_url($_GET[FLEA::getAppInf( 'controllerAccessor' )], 'remove', array(array(FLEA::getAppInf( 'columnAccessor' ) => $_colkey))); ?>';
        if(confirm("您是要删除这项内容吗?")) {
            document.location = removeUrl + '&commentid=' + id;
            return true;
        }
        return false;
    }
//-->
</script>
</body>
</html>